<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link href="${pageContext.request.contextPath }/css/Style.css"
			type="text/css" rel="stylesheet">
		<link href="${pageContext.request.contextPath }/css/admin.css"
			type="text/css" rel="stylesheet">
		<script type="text/javascript"
			src="${pageContext.request.contextPath }/js/img.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath }/js/jquery-1.3.2.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath }/js/select.js"></script>
		<script type="text/javascript">
			//删除
function delDataById(id,nid) {
	if(id.length < 1) {
		return;
	}
	if (confirm("\u786e\u5b9a\u8981\u5220\u9664\u5417\uff1f")) {
		window.self.location = "delPublicObj.htm?id="+id+"&nid="+nid;
	}
}

//上下页
function toPage(currentPage) {
	window.self.location = "getAllTeams.htm?currentPage="+currentPage;
}

//跳到添加页
function addData(url) {
     window.self.location = url;
     //window.showModalDialog(url,"newwin","dialogHeight: 500px; dialogWidth: 700px; dialogTop: 100px; dialogLeft: 255px; edge: Raised;");

}


//跳转修改
function updatePage(url,id) {
	if(id.length < 1) {
		return;
	}
	window.self.location = url+id;
	//window.showModalDialog(url,"new","dialogHeight: 500px; dialogWidth: 700px; dialogTop: 100px; dialogLeft: 255px; edge: Raised;");
}


		</script>


		<title>公共文字</title>
	</head>
	<body>
		<form action="${pageContext.request.contextPath }/admin/getProduct.htm"
			method="post" id="n_form">
			<table cellspacing="0" cellpadding="0" border="0" align="center"
				width="800">
				<tbody>
					<tr>
						<table width="100%" cellspacing="0" cellpadding="0"
							bordercolor="#003366" border="1" class="Table1" align="left">
							<tbody>
								<tr height="30px">
									
									<td colspan="6" class="thead">
										当前位置:
									<c:if test="${pub.nid == 5 or nid == 5}">公司文化</c:if>
									<c:if test="${pub.nid == 18 or nid == 18}">装修流程</c:if>
										<c:if test="${pub.nid == 19 or nid == 19}">服务范围</c:if>
										<br><br>
										
								</tr>
								<tr>
									<td colspan="6">
									<c:if test="${empty pub.title }">
												<span class="top_c"><input type="button" class="btn"
												onclick="addData('${pageContext.request.contextPath }/admin/admin.publicobj.add.jsp?nid=${nid }');"
												value="添加"> </span>
										</c:if>
										<c:if test="${!empty pub.title}">
												<input type="button" class="btn" disabled="disabled"
												onclick="addData('${pageContext.request.contextPath }/admin/admin.publicobj.add.jsp?nid=${nid }');"
												value="添加"> </span>
										</c:if>
										<span class="top_c"><input type="button" class="btn"
												onclick="updatePage('${pageContext.request.contextPath }/admin/toUpdatePublicObj.htm?id=','${pub.id }');" value="修改"> </span>
										<span class="top_c"><input type="button" class="btn"
												onclick="delDataById('${pub.id }','${pub.nid}');" value="删除"> </span>
									</td>
								</tr>
								<tr style="font-weight: bold; background: #EEEEEE;">
									<td height="25" align="center" >
										<font>标题</font>
									</td>
									<td height="25" align="center">
										提交时间
									</td>
									<td height="25" align="center" width="40%">
										内容简介
									</td>
									
								</tr>
									<tr>
										<td height="25"  style="vertical-align: top;text-align: center;">
											${pub.title }
										</td>
										<td height="25"  style="vertical-align: top;text-align: center;">
											<fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${pub.recordTime }"/>
										</td>
										
										<td height="25" align="center" width="40%">
											<s:property value="pub.content" escape="false"/>
										</td>
										
									</tr>
							</tbody>
						</table>

					</tr>
					<tr>
						<td style="height: 10px;" colspan="4"></td>
					</tr>

					<tr>
					</tr>
				</tbody>
			</table>
			<input type="hidden" name="nid" value="${pub.nid}">
			<input type="hidden" name="currentPage" value="" id="currentPage">
		</form>
	</body>
</html>